import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * Created by thinkjoy on 2017/9/15.
 */
public class ConsumInfoListSort {

    public static void main(String[] args) {
        List<ConsumInfo> consumInfoList=new ArrayList<>();
        ConsumInfo consumInfo1 = new ConsumInfo(100, "consumInfo1", 400.0,new Date());
        ConsumInfo consumInfo2 = new ConsumInfo(200, "consumInfo2", 200.0,new Date());
        ConsumInfo consumInfo3 = new ConsumInfo(300, "consumInfo3", 100.0,new Date());
        ConsumInfo consumInfo4 = new ConsumInfo(400, "consumInfo4", 700.0,new Date());
        ConsumInfo consumInfo5 = new ConsumInfo(500, "consumInfo5", 1000.0,new Date());
        ConsumInfo consumInfo6 = new ConsumInfo(600, "consumInfo6", 200.0,new Date());
        ConsumInfo consumInfo7 = new ConsumInfo(700, "consumInfo7", 900.0,new Date());
        ConsumInfo consumInfo8 = new ConsumInfo(800, "consumInfo8", 400.0,new Date());
        consumInfoList.add(consumInfo1);
        consumInfoList.add(consumInfo2);
        consumInfoList.add(consumInfo3);
        consumInfoList.add(consumInfo4);
        consumInfoList.add(consumInfo5);
        consumInfoList.add(consumInfo6);
        consumInfoList.add(consumInfo7);
        consumInfoList.add(consumInfo8);
        Collections.sort(consumInfoList);
        System.out.println("排序后:");
        for (ConsumInfo c :consumInfoList) {
            System.out.println(c);
        }

    }
}
